package com.llkj.qingnianguoxue.adapter;

import android.widget.ImageView;
import android.widget.TextView;

import com.chad.library.adapter.base.BaseQuickAdapter;
import com.chad.library.adapter.base.BaseViewHolder;
import com.llkj.qingnianguoxue.R;
import com.llkj.qingnianguoxue.bean.CircleListBean;
import com.llkj.qingnianguoxue.util.ImageLoadingUtil;

import java.util.List;

/**
 * 全部成员禁言、警告
 */
public class MemberWarningAdapter extends BaseQuickAdapter<CircleListBean.CircleBean, BaseViewHolder> {

    private int mType;
    public MemberWarningAdapter(int layoutResId, List<CircleListBean.CircleBean> data) {
        super(layoutResId, data);
    }

    @Override
    protected void convert(BaseViewHolder baseViewHolder, CircleListBean.CircleBean item) {
        ImageLoadingUtil.loadingImg((ImageView) baseViewHolder.getView(R.id.iv_head),item.getUserpic(),0);
        baseViewHolder.setText(R.id.tv_name, item.getUsername());

        TextView tvWarning = baseViewHolder.getView(R.id.tv_warning);
        if(mType==1){//禁言
            tvWarning.setText("禁言");
        }else{//警告

        }

        baseViewHolder.addOnClickListener(R.id.tv_warning);
    }

    /**
     * 设置操作类型，1禁言，默认警告
     * @param type
     */
    public void setType(int type){
        mType = type;
    }
}
